<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>分类管理</title>
    
    <link rel="stylesheet" type="text/css" href="http://localhost/www/item/yushen/Static/hdjs/hdui.css"/>
    <script type="text/javascript" src="http://localhost/www/item/yushen/Static/jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
    //给js AJAX 声明函数  
    //给controller 这个函数赋值 路径
    	var CONTROLLER = "http://localhost/www/item/yushen/index.php/Admin/Category";
    </script>
    <script type="text/javascript" src="http://localhost/www/item/yushen/Application/Admin/View/Category/js/js.js"></script>
    <link rel="stylesheet" type="text/css" href="http://localhost/www/item/yushen/Static/bootstrap/css/bootstrap.min.css"/>
	<style type="text/css">
        .plus_minus{
            width: 20px;
        }
        a:hover{
        	text-decoration: none;
        }
    </style>
</head>
<body>
<div class="wrap">
    <table class="table2">
        <thead>
        <tr pid=0>
            <td width="30"></td>
            <td>分类id</td>
            <td>分类名称</td>
            <td>分类排序</td>
            <td>分类图片</td>
            <td width="200">操作</td>
        </tr>
        </thead>
        <tbody>
        	
        	<!--循环数组中的键值和键名-->
        		<?php foreach ($data as $k=>$v){?>
        			<!--给这个tr加一个PID然后在JS里就可以隐藏了-->
        		<tr pid="<?php echo $v['pid'];?>" cid="<?php echo $v['cid'];?>">
            		<td width="30">
            			<a href="javascript:;" class="glyphicon glyphicon-plus a-plus" cid="<?php echo $v['cid'];?>"></a>
            		</td>
            		<td><?php echo $v['cid'];?></td>
            		<td><?php echo $v['cname'];?></td>
            		<td><?php echo $v['sort'];?></td>
            		<td>
            			<img src="http://localhost/www/item/yushen/<?php echo $v['catepic'];?>"alt="" style="width: 50px;height: 50px; margin-left: 20px;"/>
            		</td>
            		<td width="200">
		            	<a href="<?php echo U('Category/add_son',array('cid'=>$v['cid']));?>" class="btn btn-primary btn-xs">添加子分类</a>
		            	<a href="<?php echo U('Category/edit',array('cid'=>$v['cid']));?>" class="btn btn-info btn-xs">修改</a>
		            	<!--弹出是否删除  点击确定删除 会跳到删除方法  选择用where方法array 中的 cid=>的cid-->
		            	<a href="javascript:;" class="btn btn-danger btn-xs" onclick="if(confirm('确定删除吗？')) location.href='<?php echo U('Category/del_data',array('cid'=>$v['cid']));?>'">删除</a>
					</td>
            	</tr>
           <?php }?>
        </tbody>
    </table>
    <div class="page_hdjob">
        
    </div>
</div>

</body>
</html>


